package com.pn.taikao.mapper;

import com.pn.taikao.entity.Question;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface QuestionMapper {
    int insert(Question question);

    int update(Question question);

    int deleteById(@Param("id") Long id);

    Question selectById(@Param("id") Long id);

    List<Question> selectByCourseId(@Param("courseId") Long courseId);

    List<Question> selectPage(@Param("type") String type,
                               @Param("courseId") Long courseId,
                               @Param("difficulty") String difficulty,
                               @Param("content") String content,
                               @Param("offset") int offset,
                               @Param("limit") int limit);

    long count(@Param("type") String type,
               @Param("courseId") Long courseId,
               @Param("difficulty") String difficulty,
               @Param("content") String content);
}



